if 5 > 2:
    print("1111111")
else:
    print("222222")

int
score = 98
if score <= 60 and score > 0:
    print("不及格")
elif score >= 60 and score < 80:
    print("及格")
elif score >= 80 and score < 100:
    print("优秀")
else:
    print("成绩有误")

# if嵌套
a = 7
b = 8
c = 9
if a > b:
    if a > c:
        print("Max = a")
    else:
        print("Max = c")
else:
    if b > c:
        print("Max = b")
    else:
        print("Max = c")

# 猜数字
print("----------------------------------------------------------------------")

# while语句
num = 100

for i in range(1, num + 1):
    if i % 7 == 0 or (i % 7 != 0 and str(i).count("7")):
        print(i, end=' ')

for i in range(1, num + 1):
    if i % 7 == 0 or ("7" in str(i)):
        print(i, end=' ')
print(end='\n')
print("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@")
# 打菱形
#  *
# ***
# *****
# ***
#  *

# num = 3
# for i in range(1, 3 + 1):
# 循环空格
#    for j in range(3 - 1, 0, -1):
#        print(" ", end='')
# 循环*
#    for k in range(1, 2 * 3, 2):
#        print("*"*k, end='')
#    print()

hang = 9
for i in range(1, ((hang - 1) // 2 + 1) * 2, 2):
    print(("*" * i).center(hang))
for i in range((2 * (hang - 1) // 2) - 1, 0, -2):
    print(("*" * i).center(hang))

# TONGYI
print("----------------------------------------------------------------------")

# 打印水仙花数
for i in range(100, 1000):
    a = i // 100  # 百位
    b = i % 100 // 10  # 十位
    c = i % 10  # 个位
    # 判断是否为水仙花数
    if a ** 3 + b ** 3 + c ** 3 == i:
        print(i)
print("----------------------------------------------------------------------")

# 完数
for i in range(1, 100):
    sum = 0
    for j in range(1, i):
        if i % j == 0:
            sum += j
    if sum == i:
        print(i)

print("----------------------------------------------------------------------")

# 打印斐波那契数列
a, b = 0, 1
for i in range(50):
    a, b = b, a + b
    print(a, end=" ")

# 打印乘法表
for i in range(1, 10):
    for j in range(1, i + 1):
        print("%d*%d=%d" % (i, j, i * j), end=" ")
    print()
